#pragma once
//define the exceptions 
#ifdef WINDOWS
#include <iostream>
#endif
namespace MEM
{
	enum ERRORCODE
	{
		RunOutOfMem = 0,
		MemTooSmall,//for create heap
		DoubleDelete,
		CantAllocZero,
		GuardError,
		CantFindFreeBlock,
		MemSizeCountError

	};

	class MemException
	{
	public:
		ERRORCODE errCode;
		char* des;
		MemException(ERRORCODE ec,char* _des):errCode(ec),des(_des)
		{}

		void Error()
		{
#ifdef WINDOWS
			std::cout<<"Error: "<<des<<std::endl;
#endif
		}
	};
}